package com.bsoft.gol.hcs.specialist.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 入组患者采集门诊住院信息实体
 *
 * @author niule
 */
@Entity
@Table(name = "patient_medical_data_collect")
public class PatientMedicalDataCollectEntity implements Serializable {
    private static final long serialVersionUID = -4593661109457372656L;
    private Long id;
    private String patientId;
    private String patientName;
    private String patientMedicalCardType;
    private String patientMedicalCardNumber;
    private String cardType;
    private String cardNumber;
    private Long chronicDiseaseId;
    private String chronicDiseaseName;
    private Integer recordType;
    private String recordId;
    private Long followRecordId;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date recordTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh_CN", timezone = "GMT+8")
    private Date collectTime;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "patient_id")
    public String getPatientId() {
        return patientId;
    }

    public void setPatientId(String patientId) {
        this.patientId = patientId;
    }

    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }

    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    @Column(name = "patient_medical_card_type")
    public String getPatientMedicalCardType() {
        return patientMedicalCardType;
    }

    public void setPatientMedicalCardType(String patientMedicalCardType) {
        this.patientMedicalCardType = patientMedicalCardType;
    }

    @Column(name = "patient_medical_card_number")
    public String getPatientMedicalCardNumber() {
        return patientMedicalCardNumber;
    }

    public void setPatientMedicalCardNumber(String patientMedicalCardNumber) {
        this.patientMedicalCardNumber = patientMedicalCardNumber;
    }

    @Column(name = "card_type")
    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    @Column(name = "card_number")
    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    @Column(name = "chronic_disease_id")
    public Long getChronicDiseaseId() {
        return chronicDiseaseId;
    }

    public void setChronicDiseaseId(Long chronicDiseaseId) {
        this.chronicDiseaseId = chronicDiseaseId;
    }

    @Column(name = "chronic_disease_name")
    public String getChronicDiseaseName() {
        return chronicDiseaseName;
    }

    public void setChronicDiseaseName(String chronicDiseaseName) {
        this.chronicDiseaseName = chronicDiseaseName;
    }

    @Column(name = "record_type")
    public Integer getRecordType() {
        return recordType;
    }

    public void setRecordType(Integer recordType) {
        this.recordType = recordType;
    }

    @Column(name = "record_id")
    public String getRecordId() {
        return recordId;
    }


    public void setRecordId(String recordId) {
        this.recordId = recordId;
    }

    @Column(name = "follow_record_id")
    public Long getFollowRecordId() {
        return followRecordId;
    }

    public void setFollowRecordId(Long followRecordId) {
        this.followRecordId = followRecordId;
    }

    @Column(name = "record_time")
    public Date getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(Date recordTime) {
        this.recordTime = recordTime;
    }

    @Column(name = "collect_time")
    public Date getCollectTime() {
        return collectTime;
    }

    public void setCollectTime(Date collectTime) {
        this.collectTime = collectTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PatientMedicalDataCollectEntity that = (PatientMedicalDataCollectEntity) o;
        return id.equals(that.id) &&
                Objects.equals(patientId, that.patientId) &&
                Objects.equals(patientName, that.patientName) &&
                Objects.equals(patientMedicalCardType, that.patientMedicalCardType) &&
                Objects.equals(patientMedicalCardNumber, that.patientMedicalCardNumber) &&
                Objects.equals(cardType, that.cardType) &&
                Objects.equals(cardNumber, that.cardNumber) &&
                Objects.equals(chronicDiseaseId, that.chronicDiseaseId) &&
                Objects.equals(chronicDiseaseName, that.chronicDiseaseName) &&
                Objects.equals(recordType, that.recordType) &&
                Objects.equals(recordId, that.recordId) &&
                Objects.equals(followRecordId, that.followRecordId) &&
                Objects.equals(recordTime, that.recordTime) &&
                Objects.equals(collectTime, that.collectTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, patientId, patientName, patientMedicalCardType, patientMedicalCardNumber, cardType,
                cardNumber, chronicDiseaseId, chronicDiseaseName, recordType, recordId, recordTime, collectTime);
    }
}
